import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN'
import store from './store';
import { vueBaberrage } from 'vue-baberrage'
import VideoPlayer from 'vue-video-player'
import flvjs from 'flv.js';
require('video.js/dist/video-js.css')
require('vue-video-player/src/custom-theme.css')
Vue.use(VideoPlayer)
Vue.use(vueBaberrage)
Vue.config.productionTip = false
Vue.use(ElementUI, { locale })

const on = Vue.prototype.$on
Vue.prototype.$on = function(event, func) {
    let timer
    let newFunc = func
    if (event === 'click') {
        newFunc = function() {
            clearTimeout(timer)
            timer = setTimeout(function() {
                func.apply(this, arguments)
            }, 1000)
        }
    }
    on.call(this, event, newFunc)
}
new Vue({
    router,
    store,
    render: h => h(App),
}).$mount('#app')